package mapData;

import gui.GamePanel;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;

/**
 * Container class for TransitionNodes
 * If a Coord is determined to be a tNode, a tNode will
 * be created at the same x and y coordinate
 * and used as a node for abstract pathfinding
 * @author Kevin
 *
 */
public class TransitionNode extends Coord{
	
	private ArrayList<Coord> connectedNodes = new ArrayList<Coord>(10);
	private HashMap dTable = new HashMap(10); //hash map for storing distances 
	
	public TransitionNode(Coord a)
	{
		x = a.getX();
		y = a.getY();
	}
	
	
	
	
	public ArrayList<Coord> getEmptyNeighbors()
	{
		return connectedNodes; //occupancy not important at the moment for abstract paths
	}
	
	public void addConnectedNeighbor(TransitionNode node)	
	{
		Collections.sort(connectedNodes);
		if(Collections.binarySearch(connectedNodes, node)<0)//add new node if identical object not contained in list
		{
			connectedNodes.add(node);
			
		}
	}
	

}
